﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace wielomiany {
	public partial class Form1 : Form {
		public Form1 () {
			InitializeComponent();
		}

		private void Form1_Load (object sender, EventArgs e) {
			List<string> linie = new List<string>();
			Polynomial a = new Polynomial(
				new Complex[] { 
					new Complex(1, 1),
					new Complex(1, 0),
					new Complex(3, -1),
					new Complex(5, 1)
				}
			);
			Polynomial b = new Polynomial(
				new Complex[] {
					new Complex(3, 0),
					new Complex(5, -1),
					new Complex(2, 1)
				}
			);
			Polynomial c = new Polynomial(
				new Complex[] {
					new Complex(7, 0),
					new Complex(3, -1),
					new Complex(4, 1)
				}, new byte[,] {
					{0}, {1}, {3}
				}	
			);
			//linie.Add("1.\t"+((a*b)+c));
			a = new Polynomial(
				new Complex[] {
					new Complex(1, 0),
					new Complex(6, 0),
					new Complex(5, 0),
					new Complex(2, 0)
				}
			);
			b = new Polynomial(
				new Complex[] {
					new Complex(3, 0),
					new Complex(2, 0),
					new Complex(2, 0)
				}
			);
			c = new Polynomial(
				new Complex[] {
					new Complex(-6, 0),
					new Complex(-5, 0),
					new Complex(-4, 0)
				}, new byte[,] {{0}, {1}, {3}}
			);
			//linie.Add("2.\t" + ((a * b) - c).ToString(0));
			linie.Add("");
			a = new Polynomial(
				new Complex[] {
					new Complex(2, 0),
					new Complex(-3, 0),
					new Complex(1, 0)
				},
				new byte[,] {
					{2, 3},
					{1, 1},
					{2, 0}
				}
			);
			b = new Polynomial(
				new Complex[] {
					new Complex(1, 0),
					new Complex(-3, 0)
				},
				new byte[,] {
					{5, 1},
					{0, 0}
				}
			);
			c = new Polynomial(
				new Complex[] {
					new Complex(1, 0),
					new Complex(3, 0),
					new Complex(1, 0),
					new Complex(3, 0),
					new Complex(-10, 0)
				},
				new byte[,] {
					{7, 3},
					{4, 2},
					{1, 5},
					{1, 1},
					{0, 0}
				}
			);
			Polynomial d = new Polynomial(
				new Complex[] {
					new Complex(1, 0),
					new Complex(3, 0),
					new Complex(16, 0)
				},
				new byte[,] {
					{4, 2},
					{5,4},
					{1, 1}
				}
			);
			linie.Add("a+b=\t" + (a + b).ToString(0));
			linie.Add("a-b=\t" + (a - b).ToString(0));
			linie.Add("b-a=\t" + (b-a).ToString(0));
			linie.Add("a*b=\t" + (a * b).ToString(0));
			linie.Add("c+d=\t" + (c + d).ToString(0));
			linie.Add("c-d=\t" + (c - d).ToString(0));
			linie.Add("c*d=\t" + (c * d).ToString(0));
			linie.Add("");
			a = new Polynomial(
				new Complex[] {
					new Complex(1,0),
					new Complex(-2, 0),
					new Complex(1, 0),
					new Complex(2, 0)
				},
				new byte[,] {
					{5,3,1},
					{2,2,2},
					{1,1,1},
					{0,0,0}
				}
			);
			b = new Polynomial(
				new Complex[] {
					new Complex(3, 0),
					new Complex(2, 0)
				},
				new byte[,] {
					{2,1,1},
					{1,2,2}
				}
			);
			//linie.Add("a+b=\t" + (a + b).ToString(0));
			//linie.Add("a-b=\t" + (a - b).ToString(0));
			//linie.Add("a*b=\t" + (a * b).ToString(0));
			textBox1.Lines = linie.ToArray();
		}

		private void textBox2_TextChanged (object sender, EventArgs e) {

		}
	}
}
